/* 基础样式重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #00f7ff;
  --primary-dark: #00b3b9;
  --primary-glow: rgba(0, 247, 255, 0.5);
  --accent: #ff0066;
  --accent-glow: rgba(255, 0, 102, 0.5);
  --background: #000814;
  --surface: #0a1128;
  --surface-light: #121a2c;
  --text: #e0fbfc;
  --text-secondary: #91a8d0;
  --success: #00ff88;
  --warning: #ffb703;
  --danger: #FF3A44;
}

@font-face {
  font-family: 'CyberPunk';
  src: url('../fonts/cyber.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
}

html, body {
  height: 100%;
  width: 100%;
  overflow-x: hidden;
  font-family: 'Orbitron', sans-serif;
  background: var(--background);
  color: var(--text);
  line-height: 1.6;
}

body {
  background: radial-gradient(circle at 50% 50%, #071425, #000510);
  background-attachment: fixed;
}

/* 游戏容器 */
.game-container {
  max-width: 1200px;
  margin: 20px auto;
  background: var(--surface);
  border: 2px solid var(--primary);
  border-radius: 10px;
  box-shadow: 0 0 25px var(--primary-glow), inset 0 0 15px var(--primary-glow);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 15px;
  padding: 20px;
}

.game-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  z-index: 1;
  animation: headerGlow 3s ease-in-out infinite;
}

@keyframes headerGlow {
  0%, 100% { opacity: 0.3; transform: scaleX(0.8); }
  50% { opacity: 1; transform: scaleX(1); }
}

/* 游戏标题 */
.game-header {
  display: flex;
  flex-direction: column;
  gap: 15px;
  position: relative;
}

.title-container {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.game-title {
  text-align: center;
  font-size: 3rem;
  font-weight: 700;
  background: linear-gradient(90deg, var(--primary), #80ffea, var(--accent));
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin: 10px 0;
  position: relative;
  text-shadow: 0 0 10px var(--primary-glow);
}

.game-title span {
  display: block;
  font-size: 1rem;
  letter-spacing: 8px;
  opacity: 0.7;
}

/* 反应堆装饰 */
.reactor {
  position: absolute;
  right: 50px;
  top: 50%;
  transform: translateY(-50%);
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.reactor-core {
  width: 20px;
  height: 20px;
  background: var(--primary);
  border-radius: 50%;
  box-shadow: 0 0 15px var(--primary);
  animation: pulse 2s infinite alternate;
}

.reactor-ring {
  position: absolute;
  border: 2px solid transparent;
  border-radius: 50%;
}

.ring1 {
  width: 30px;
  height: 30px;
  border-top-color: var(--primary);
  border-bottom-color: var(--primary);
  animation: spin 3s linear infinite;
}

.ring2 {
  width: 45px;
  height: 45px;
  border-left-color: var(--primary);
  border-right-color: var(--primary);
  animation: spin 4s linear infinite reverse;
}

.ring3 {
  width: 60px;
  height: 60px;
  border-top-color: var(--primary);
  border-right-color: var(--primary);
  animation: spin 5s linear infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(0.8); opacity: 0.8; }
  50% { transform: scale(1.1); opacity: 1; }
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 游戏统计信息 */
.game-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-around;
  gap: 10px;
  background: rgba(10, 17, 40, 0.7);
  border: 1px solid var(--primary-dark);
  border-radius: 8px;
  padding: 10px;
  box-shadow: 0 0 10px rgba(0, 247, 255, 0.2), inset 0 0 5px rgba(0, 247, 255, 0.1);
}

.stat-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 80px;
  padding: 5px 10px;
  border-left: 2px solid var(--primary);
  position: relative;
  overflow: hidden;
}

.stat-box::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  text-shadow: 0 0 5px var(--primary-glow);
}

.ai-score, .ai-length {
  display: none; /* 默认隐藏AI相关信息 */
}

/* 特效容器 */
.effects-container {
  margin-top: 10px;
  border: 1px solid var(--primary-dark);
  border-radius: 8px;
  background: rgba(10, 17, 40, 0.5);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.effects-title {
  font-size: 0.9rem;
  text-transform: uppercase;
  color: var(--primary);
  border-bottom: 1px solid var(--primary-dark);
  padding-bottom: 5px;
  text-shadow: 0 0 5px var(--primary-glow);
  letter-spacing: 1px;
}

.effects-items {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-around;
  gap: 10px;
}

.effect {
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 5px;
  border-left: 3px solid;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  animation: fadeIn 0.3s;
  transition: all 0.3s;
  box-shadow: 0 0 8px currentColor;
}

.effect:hover {
  transform: translateY(-3px);
  box-shadow: 0 0 15px currentColor;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 游戏区域 */
.game-field {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.canvas-container {
  position: relative;
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

#gameCanvas {
  display: block;
  width: 100%;
  background-color: var(--background);
  image-rendering: pixelated;
}

.grid-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
    linear-gradient(rgba(0, 247, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 247, 255, 0.05) 1px, transparent 1px);
  background-size: 20px 20px;
  pointer-events: none;
}

.scanline {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgba(0, 247, 255, 0.1) 50%, rgba(0, 0, 0, 0) 100%);
  opacity: 0.2;
  animation: scan 8s linear infinite;
  pointer-events: none;
}

@keyframes scan {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(100%); }
}

/* 控制面板 */
.game-controls {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.control-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
  background: rgba(10, 17, 40, 0.5);
  border: 1px solid var(--primary-dark);
  border-radius: 8px;
  padding: 15px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.control-group label {
  font-size: 0.9rem;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 1px;
}

.slider-container {
  position: relative;
  width: 200px;
}

input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 8px;
  background: linear-gradient(90deg, var(--primary-dark), var(--primary));
  border-radius: 4px;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  background: var(--text);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 8px var(--primary);
  transition: all 0.2s;
}

input[type="range"]::-webkit-slider-thumb:hover {
  background: var(--primary);
  box-shadow: 0 0 12px var(--primary);
}

.slider-value {
  position: absolute;
  top: -25px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: var(--background);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: bold;
  width: 25px;
  text-align: center;
}

.slider-value::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid var(--primary);
}

.difficulty-select {
  background: var(--surface-light);
  color: var(--text);
  border: 2px solid var(--primary-dark);
  border-radius: 4px;
  padding: 8px 15px;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.9rem;
  cursor: pointer;
  outline: none;
  transition: border-color 0.3s, box-shadow 0.3s;
  width: 200px;
}

.difficulty-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 8px var(--primary-glow);
}

.difficulty-select option {
  background: var(--surface);
  color: var(--text);
}

/* 按钮样式 */
.button-group {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  padding: 10px 0;
}

.cyber-button {
  position: relative;
  background: transparent;
  color: var(--primary);
  font-family: 'Orbitron', sans-serif;
  font-size: 1rem;
  padding: 10px 20px;
  border: 2px solid var(--primary);
  border-radius: 0;
  cursor: pointer;
  outline: none;
  overflow: hidden;
  transition: all 0.3s;
  min-width: 120px;
  text-transform: uppercase;
  box-shadow: 0 0 5px var(--primary-glow);
  clip-path: polygon(0 10%, 10% 0, 90% 0, 100% 10%, 100% 90%, 90% 100%, 10% 100%, 0 90%);
}

.cyber-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, var(--primary-glow), transparent);
  transition: all 0.6s;
}

.cyber-button:hover {
  color: var(--background);
  background: var(--primary);
  box-shadow: 0 0 15px var(--primary);
  transform: translateY(-2px);
}

.cyber-button:hover::before {
  left: 100%;
}

.button-content {
  position: relative;
  z-index: 1;
}

.button-glitch {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--primary);
  z-index: 0;
  opacity: 0;
  transition: opacity 0.2s;
  mix-blend-mode: screen;
}

.cyber-button:active .button-glitch {
  opacity: 0.3;
  animation: glitch 0.3s steps(2) forwards;
}

@keyframes glitch {
  0% { transform: translate(0); }
  20% { transform: translate(-5px, 5px); }
  40% { transform: translate(-5px, -5px); }
  60% { transform: translate(5px, 5px); }
  80% { transform: translate(5px, -5px); }
  100% { transform: translate(0); }
}

.toggle-button {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--text-secondary);
  box-shadow: none;
}

.toggle-button.active {
  background: var(--primary);
  color: var(--background);
  border-color: var(--primary);
  box-shadow: 0 0 15px var(--primary-glow);
}

#startBtn {
  background: var(--success);
  color: var(--background);
  border-color: var(--success);
  box-shadow: 0 0 15px rgba(0, 255, 136, 0.5);
}

#pauseBtn {
  display: none;
}

/* 移动设备控制 */
.mobile-controls {
  display: none;
  position: relative;
  width: 100%;
  margin: 15px 0;
  background: rgba(10, 17, 40, 0.3);
  border-radius: 10px;
  padding: 15px;
}

.controls-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 400px;
  margin: 0 auto;
}

.d-pad {
  display: grid;
  grid-template-areas:
    ". up ."
    "left . right"
    ". down .";
  gap: 5px;
  width: 150px;
  height: 150px;
}

.direction-btn {
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(0, 247, 255, 0.1);
  color: var(--primary);
  border: 1px solid var(--primary);
  border-radius: 8px;
  width: 45px;
  height: 45px;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 0 5px var(--primary-glow);
}

.direction-btn svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.direction-btn:active {
  background: var(--primary);
  color: var(--background);
  transform: scale(0.9);
}

.up-btn { grid-area: up; }
.left-btn { grid-area: left; }
.right-btn { grid-area: right; }
.down-btn { grid-area: down; }

/* 加速按钮样式 */
.action-buttons {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
}

.boost-btn {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--accent), #800033);
  border: 2px solid var(--accent);
  color: var(--text);
  font-family: 'Orbitron', sans-serif;
  font-size: 0.9rem;
  font-weight: bold;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 0 15px var(--accent-glow);
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow: hidden;
  transition: all 0.3s;
}

.boost-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at center, rgba(255,255,255,0.2) 0%, transparent 70%);
  pointer-events: none;
}

.boost-btn:active, .boost-btn.active {
  transform: scale(0.9);
  box-shadow: 0 0 25px var(--accent);
}

.boost-btn.active {
  background: radial-gradient(circle at 30% 30%, #ff3881, var(--accent));
  animation: boostPulse 0.5s infinite alternate;
}

@keyframes boostPulse {
  from { box-shadow: 0 0 15px var(--accent-glow); }
  to { box-shadow: 0 0 30px var(--accent), 0 0 40px var(--accent-glow); }
}

.boost-btn::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid var(--accent);
  animation: pulseRing 2s infinite;
  opacity: 0;
}

.boost-btn.active::after {
  opacity: 0.8;
  animation: pulseRing 1s infinite;
}

@keyframes pulseRing {
  0% { transform: scale(0.8); opacity: 0; }
  50% { opacity: 0.5; }
  100% { transform: scale(1.4); opacity: 0; }
}

/* 食物指南 */
.food-guide {
  background: rgba(10, 17, 40, 0.5);
  border: 1px solid var(--primary-dark);
  border-radius: 8px;
  padding: 15px;
  margin-top: 10px;
}

.guide-title {
  text-align: center;
  color: var(--primary);
  font-size: 1.2rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 15px;
  position: relative;
  text-shadow: 0 0 5px var(--primary-glow);
}

.guide-title::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 50px;
  height: 2px;
  background: var(--primary);
  box-shadow: 0 0 5px var(--primary);
}

.food-items {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-around;
  gap: 10px;
}

.food-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.3);
  transition: all 0.3s;
}

.food-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.food-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
}

.food-icon.normal {
  background: radial-gradient(circle at 30% 30%, #4CAF50, #388E3C);
  box-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
}

.food-icon.speedBoost {
  background: radial-gradient(circle at 30% 30%, #FFC107, #FF9800);
  box-shadow: 0 0 10px rgba(255, 193, 7, 0.5);
}

.food-icon.doubleScore {
  background: radial-gradient(circle at 30% 30%, #9C27B0, #7B1FA2);
  box-shadow: 0 0 10px rgba(156, 39, 176, 0.5);
}

.food-icon.shield {
  background: radial-gradient(circle at 30% 30%, #2196F3, #1976D2);
  box-shadow: 0 0 10px rgba(33, 150, 243, 0.5);
}

.food-info {
  display: flex;
  flex-direction: column;
}

.food-name {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
}

.food-desc {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* 模态框 */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal-content {
  position: relative;
  background: var(--surface);
  border: 2px solid var(--primary);
  border-radius: 10px;
  padding: 25px;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 0 30px var(--primary-glow), inset 0 0 15px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  animation: modalAppear 0.5s;
}

@keyframes modalAppear {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
}

.modal-header {
  text-align: center;
  margin-bottom: 20px;
  position: relative;
}

.mode-badge {
  display: inline-block;
  padding: 5px 10px;
  margin-bottom: 10px;
  font-size: 0.8rem;
  border-radius: 5px;
  background: var(--primary);
  color: var(--background);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.modal-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 2px;
  text-shadow: 0 0 10px var(--primary-glow);
}

.score-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
  margin: 20px 0;
}

.score-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 5px;
}

.score-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.score-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  text-shadow: 0 0 5px var(--primary-glow);
}

.modal-buttons {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 20px;
  flex-wrap: wrap;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .game-container {
    margin: 10px;
    padding: 10px;
  }
  
  .game-title {
    font-size: 2rem;
  }
  
  .reactor {
    width: 40px;
    height: 40px;
    right: 20px;
  }
  
  .score-container {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .control-panel {
    flex-direction: column;
  }
  
  .mobile-controls {
    display: block;
  }
  
  .controls-wrapper {
    max-width: 320px;
  }
  
  .d-pad {
    width: 130px;
    height: 130px;
  }
  
  .direction-btn {
    width: 40px;
    height: 40px;
  }
  
  .boost-btn {
    width: 60px;
    height: 60px;
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  .game-title {
    font-size: 1.5rem;
  }
  
  .stat-box {
    min-width: 70px;
  }
  
  .stat-value {
    font-size: 1.2rem;
  }
  
  .food-items {
    flex-direction: column;
  }
  
  .controls-wrapper {
    max-width: 280px;
  }
  
  .d-pad {
    width: 120px;
    height: 120px;
  }
  
  .direction-btn {
    width: 35px;
    height: 35px;
  }
  
  .direction-btn svg {
    width: 18px;
    height: 18px;
  }
  
  .boost-btn {
    width: 50px;
    height: 50px;
    font-size: 0.7rem;
  }
}

/* 动画效果 */
@keyframes moveGradient {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes glow {
  0%, 100% { box-shadow: 0 0 10px var(--primary-glow); }
  50% { box-shadow: 0 0 20px var(--primary-glow), 0 0 30px var(--primary-glow); }
}

/* 分数弹出动画 */
.score-pop {
  position: absolute;
  color: var(--primary);
  font-size: 1.2rem;
  font-weight: bold;
  text-shadow: 0 0 5px var(--primary);
  z-index: 100;
  pointer-events: none;
  animation: scorePop 1s forwards;
}

@keyframes scorePop {
  0% { transform: translateY(0) scale(0.5); opacity: 0; }
  50% { transform: translateY(-20px) scale(1.5); opacity: 1; }
  100% { transform: translateY(-40px) scale(1); opacity: 0; }
}

/* 屏幕抖动效果 */
.shake {
  animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
  20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* 暂停效果 */
.canvas-container.paused::after {
  content: '已暂停';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 2rem;
  text-transform: uppercase;
  letter-spacing: 5px;
  z-index: 10;
  backdrop-filter: blur(3px);
  animation: pauseGlow 2s infinite alternate;
}

@keyframes pauseGlow {
  0% { text-shadow: 0 0 5px var(--primary-glow); }
  100% { text-shadow: 0 0 20px var(--primary), 0 0 30px var(--primary); }
}

/* 故障效果 */
.canvas-container.glitch {
  animation: glitchEffect 0.5s steps(2) forwards;
}

@keyframes glitchEffect {
  0% { transform: translate(0); filter: hue-rotate(0deg); }
  10% { transform: translate(-5px, 5px); filter: hue-rotate(90deg); }
  20% { transform: translate(-5px, -5px); filter: hue-rotate(180deg); }
  30% { transform: translate(5px, 5px); filter: hue-rotate(270deg); }
  40% { transform: translate(5px, -5px); filter: hue-rotate(360deg); }
  50% { transform: translate(0); filter: hue-rotate(0deg); }
  60% { transform: translate(-3px, 3px); filter: saturate(2); }
  70% { transform: translate(3px, -3px); filter: saturate(0.5); }
  80% { transform: translate(0); filter: hue-rotate(0deg); }
  90% { transform: translate(-2px, 2px); filter: brightness(1.2); }
  100% { transform: translate(0); filter: none; }
}

/* 模态框粒子 */
.modal-particle {
  position: absolute;
  background-color: var(--primary);
  border-radius: 50%;
  pointer-events: none;
  animation: floatParticle 4s infinite alternate;
}

@keyframes floatParticle {
  0% { transform: translate(0, 0) rotate(0deg); opacity: 0.3; }
  50% { opacity: 0.8; }
  100% { transform: translate(20px, -20px) rotate(360deg); opacity: 0.3; }
}

/* 按钮悬停效果增强 */
.cyber-button:hover {
  animation: buttonHover 2s infinite;
}

@keyframes buttonHover {
  0%, 100% { box-shadow: 0 0 15px var(--primary); }
  50% { box-shadow: 0 0 25px var(--primary), 0 0 35px var(--primary-glow); }
}

/* 活动的食物效果 */
@keyframes foodPulse {
  0%, 100% { transform: scale(0.9); opacity: 0.8; }
  50% { transform: scale(1.1); opacity: 1; box-shadow: 0 0 20px currentColor; }
}

.food-icon {
  animation: foodPulse 2s infinite;
}

/* 添加额外的反应堆风格 */
.reactor-core::after {
  content: '';
  position: absolute;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0,247,255,0.1) 0%, rgba(0,247,255,0) 70%);
  animation: reactorPulse 3s infinite;
}

@keyframes reactorPulse {
  0%, 100% { transform: scale(1); opacity: 0; }
  50% { transform: scale(2); opacity: 0.5; }
}

/* 游戏介绍区域样式 */
.game-instructions {
  background: rgba(10, 17, 40, 0.7);
  border: 1px solid var(--primary-dark);
  border-radius: 8px;
  padding: 15px;
  margin-top: 15px;
  box-shadow: 0 0 15px rgba(0, 247, 255, 0.2), inset 0 0 8px rgba(0, 247, 255, 0.1);
}

.instructions-title {
  font-size: 1.3rem;
  text-transform: uppercase;
  color: var(--primary);
  text-align: center;
  margin-bottom: 15px;
  text-shadow: 0 0 5px var(--primary-glow);
  letter-spacing: 2px;
  border-bottom: 1px solid var(--primary-dark);
  padding-bottom: 8px;
  position: relative;
}

.instructions-title::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  animation: instructionGlow 3s ease-in-out infinite;
}

@keyframes instructionGlow {
  0%, 100% { width: 80px; opacity: 0.5; }
  50% { width: 150px; opacity: 1; }
}

.instructions-content {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-around;
  gap: 20px;
}

.instruction-section {
  flex: 1;
  min-width: 250px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 5px;
  border-left: 3px solid var(--primary);
}

.instruction-section h4 {
  color: var(--primary);
  margin-bottom: 10px;
  font-size: 1rem;
  letter-spacing: 1px;
}

.instruction-section ul {
  list-style-type: none;
  padding-left: 5px;
}

.instruction-section li {
  margin-bottom: 8px;
  font-size: 0.9rem;
  position: relative;
  padding-left: 15px;
  line-height: 1.4;
}

.instruction-section li::before {
  content: '▶';
  color: var(--primary);
  position: absolute;
  left: 0;
  font-size: 0.7rem;
}

.key-highlight {
  background: rgba(0, 247, 255, 0.1);
  border: 1px solid var(--primary-dark);
  padding: 2px 5px;
  border-radius: 3px;
  font-family: monospace;
  color: var(--primary);
  font-weight: 500;
}

.mode-highlight {
  color: var(--accent);
  font-weight: 500;
}

/* 加载屏幕 */
.loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--background);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease;
}

.loading-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.loading-title {
  font-size: 2rem;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 3px;
  text-shadow: 0 0 10px var(--primary-glow);
  animation: pulseText 1.5s infinite alternate;
}

@keyframes pulseText {
  from { opacity: 0.7; text-shadow: 0 0 5px var(--primary-glow); }
  to { opacity: 1; text-shadow: 0 0 15px var(--primary-glow), 0 0 30px var(--primary-glow); }
}

.loading-spinner {
  width: 60px;
  height: 60px;
  border: 3px solid transparent;
  border-top-color: var(--primary);
  border-right-color: var(--accent);
  border-radius: 50%;
  animation: loadingSpin 1s linear infinite;
  position: relative;
}

.loading-spinner::after {
  content: '';
  position: absolute;
  top: 5px;
  left: 5px;
  right: 5px;
  bottom: 5px;
  border: 3px solid transparent;
  border-bottom-color: var(--primary);
  border-left-color: var(--accent);
  border-radius: 50%;
  animation: loadingSpin 1.5s linear infinite reverse;
}

@keyframes loadingSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-progress {
  color: var(--text-secondary);
  font-size: 1rem;
  letter-spacing: 1px;
}

/* 媒体查询调整 */
@media (max-width: 768px) {
  .game-instructions {
    padding: 10px;
  }
  
  .instructions-title {
    font-size: 1.1rem;
  }
  
  .instruction-section {
    min-width: 100%;
  }
  
  .mobile-hide {
    display: none;
  }
} 